<!DOCTYPE html>

<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">

    <meta content="width=device-width, initial-scale=1.0" name="viewport">

    <title>Document</title>
    <script th:src="@{/static/layui/layui.js}"></script>
    <link rel="stylesheet" th:href="@{/static/layui/css/layui.css}">

    <!-- 要是用layui，需要引入1个js，一个css -->


</head>

<body>

<button id="bt">测试</button>

<script>

    layui.use(['layer', 'form', 'jquery'], function (args) {

        var $ = layui.jquery;

        $('#bt').click(function () {

            $.ajax({
                type: "get",
                url: "/toLogin",
                async: true,
                // data: JSON.stringify({
                //     userName: user_name,
                //     passWord: pass_word
                // }),
                dataType: "json",
                contentType: "application/json;charset=UTF-8",
                success: function (res) {
                    console.log(res)
                }
            })

        })

    });

</script>

</body>

</html>
